Fragmentation is a term which is used in the context of file systems. Fragmentation occurs when objects (e.g. files) of different sizes are repeatedly created and deleted. If, for example, an object in a file system has been deleted and afterwards a new object is created, this object does not necessarily fit into the gap which emerged by the previous deletion. Typically, an Operating System (OS) will then split up the new object and fill up smaller gaps. Hence the file is fragmented. Fragmentation forces the Operating System to store meta data which maintains the link between the fragmented data and the memory locations. This leads to drawbacks like slow-down of file access due to handling of the meta data and file fragments by the OS, and loss of memory capacity due to stored meta data. The more meta data have to be maintained, the fewer payload data can be stored.
As a result, defragmentation tools have been developed for rich file systems such as FAT (File Allocation Table) or NTFS (New Technology File System) which take account of this problem. Defragmentation tools of this kind have direct access to hardware components such as like hard disks or other non-volatile data storage devices. Defragmentation applications sort data by shuffling the objects and storing them in one continuous memory chunk. However, this process needs many read/write processes, an effective sorting mechanism and also a significant amount of time.
Defragmentation tools of this kind are widely used in the PC world for storage devices, such as hard disks being incorporated into the computer device. However, such defragmentation applications are not commonly employed in smart card technology due to the fact that defragmentation algorithms are complex and therefore demand significant space on non-volatile memory of the smart card. However, it should be mentioned that there are some smart cards that are able to carry out defragmentation, e.g. so called “JavaCards”. Besides, a smart card is usually only powered when it has to perform some service but not for maintenance operations. Thus, there is no time scheduled to perform such operations. Furthermore, the non-volatile memory of the card is irreversibly damaged when a certain number of write cycles is exceeded, since the number of cycles is limited to a few 100,000 operations.
From U.S. Pat. No. 6,885,395 B1 a method for selectively adjusting resolution levels or quality levels of digital images stored in a digital camera memory is known. As quality levels are reduced from previously stored images, the available memory becomes fragmented. To minimize the time required to store new images and to access these newly stored images, the memory card is defragmented by using defragmentation algorithms known from the art. If the memory card uses Flash EPROM memory, which is organized in memory sectors, those can be erased and rewritten in order to defragment the Flash EPROM card.
EP 1 046 996 B1, DE 100 40 241 A1 and WO 2004/066153 A1 disclose methods for on-card defragmentation of memory on a smart card.